
module.exports = class extends think.Service {
    /**
     * 获取html的服务
     * @param {*} url 
     */
    async getHtml(url) {
      if(think.isEmpty(url)) {
        return {fail: true};
      };
      const json = await this.fetch(url, {
        headers: {
          'Cookie': `oHAcoULcWCQb80S=eZgjuB_c_2l9bjA8xNvv5BkmXBcpTL._5Ybz.RFiUp8pGyeuRgWV8n9OnNqh8n4u; insert_cookie=67313298; yfx_c_g_u_id_10006654=_ck20032219411613385878913983558; yfx_f_l_v_t_10006654=f_t_1584877276326__r_t_1584877276326__v_t_1584877276326__r_c_0; oHAcoULcWCQb80T=4zOU68YbWkqJk6xxZ4BGi4_mesIb1YBTjy7RrQVNt77bQSawAkHj8G87wpOOwZkpS9LzRkD4wyEKwr4yHpxnCX1CvLM3oYXlgsrIEbaZH3LIC2pf2Fv8m9OzfjxX72PzP468XowZCo.Stq2Q6fv_7IYwkJuaa0825cZ4L2mtmlWzvf5p6ILLgeVfjb3EoewASqoY_kzv5EbBc1zMNCubrlMVyBOblbcvnLFekYLpo2JW8Perou.C6V05iP4Mo2lIqEBABtKWIjQKiNdclN2X0pzLQl2093ACd7u4xsiX0qJfa.MkDqg0RgzySED0p.O8ISnl; security_session_verify=81cf04eecfaa68d9007779d286c3bcb0`,
          'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36'
        }
      }).then(res => {
        return res.text()
      }).catch(err =>{
        return {fail: true};
      });
      return json;
    }
};
  